// index.js
// 获取应用实例
Page({
  data: {
    fruits:[{ fruit: '苹果' }, { fruit: '番茄' },{ fruit: '草莓' },{ fruit: '桃子' },{ fruit: '杏' }],

    selectedFruits:"苹果",
    isShow:true,//是否显示左侧按钮
    backgroundColor:'#efefef',//背景颜色
    navTitle:'首页',//标题
    isWhite:true,//是否白色胶囊
    titleColor:'black',//字体颜色
  },
  goToQACircle(){
    wx.navigateTo({
      url: '/pages/qacircle/qacircle',
    })
  },
  goToPolicyInterpretation: function() {
    wx.navigateTo({
      url: '/pages/policy/policy',
    })
  },

  // 事件处理函数
  bindPickerChange1: function (e) {
    this.setData({
      selectedFruits: this.data.fruits[e.detail.value].fruit
    });
    console.log(this.data.selectedFruits)
  },

query(){
  wx.switchTab({
    url: '/pages/query/query',
  })
},
 
  clickme:function(e)//动作函数，完成点击动作（上传按钮的跳转页面）
  {
    wx.navigateTo({
      url: `/pages/upload/upload?fruit=${this.data.selectedFruits}`,
    })//点击后到达上传页面
  },
  water(){
    wx.navigateTo({
      url: '/pages/water/water',
    })
  },
  dosage(){
    wx.navigateTo({
      url: '/pages/dosage/dosage',
    })
  },

})
